package com.fruit.service.impl;

import com.fruit.dao.FruitDAO;
import com.fruit.dao.impl.FruitDAOImpl;
import com.fruit.pojo.Fruit;
import com.fruit.service.FruitService;

import java.util.List;

public class FruitServiceImpl implements FruitService {

    private FruitDAO fruitDAO = new FruitDAOImpl();

    @Override
    public void addFruit(Fruit fruit) throws Exception {
        fruitDAO.addFruit(fruit);
    }

    @Override
    public List<Fruit> getFruitList(Fruit fruit) throws Exception {
        return fruitDAO.getFruitList(fruit);
    }

    @Override
    public void deleteFruit(Integer id) throws Exception {
        fruitDAO.deleteFruit(id);
    }

    @Override
    public Fruit getFruitById(Integer id) throws Exception {
        return fruitDAO.getFruitById(id);
    }
}
